Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideUIAdd an onEntered handler that rejects overflow-popup drags, showing a forbidden cursor when dragging items over the overflow area.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/taskmanager/package/TaskOverflowButton.qml" line_range="265" />
<code_context>
keys: ["text/x-dde-dock-dnd-appid", "text/x-dde-dock-dnd-folder"]
+ onEntered: function(drag) {
+ if (drag.getDataAsString("text/x-dde-dock-dnd-source") === "overflow-popup")
+ drag.accept(Qt.MoveAction)
+ }
onDropped: function(drop) {
</code_context>
<issue_to_address>
**Move cursor remains copy cursor**
When an `overflow-popup` drag enters the popup DropArea, `DragEvent` does not provide `accept(Qt.MoveAction)`, so the handler raises a QML runtime error before accepting the drag and the cursor remains in the default copy state.
Set the DragEvent's drop action to `Qt.MoveAction` with its supported API, then accept the event.
</issue_to_address>
|
1. Root cause: the overflow popup DropArea in TaskOverflowButton.qml onEntered handler called drag.accept(Qt.MoveAction), which shows a move cursor. The expected behavior is a forbidden (no-drop) cursor when dragging overflow-popup items over the overflow area 2. Fix: change drag.accept(Qt.MoveAction) to drag.accept(Qt.IgnoreAction) in onEntered so the cursor shows a forbidden icon. onDropped for overflow-popup source is retained but won't fire since the drag is rejected at enter time — this is the intended behavior 3. Impact: only affects cursor display during drag-enter into the overflow popup for overflow-popup drag source; other drag sources and drop behaviors are unchanged Log: overflow popup now shows forbidden cursor instead of move cursor when dragging items inside it Influence: 1. Drag an app icon inside the overflow popup and verify the cursor shows a forbidden (no-drop) icon instead of a move cursor 2. Drag an app icon from the taskbar into the overflow popup and verify the cursor and drop behavior are unchanged 3. Drag an app icon out of the overflow popup and verify residence is preserved fix: 修复溢出区域拖拽时光标应显示为禁止状态 1. 根因:溢出弹窗 DropArea 的 onEntered 调用 drag.accept(Qt.MoveAction), 光标显示为移动光标,但预期行为为禁止光标(不允许放置) 2. 方案:将 onEntered 中的 drag.accept(Qt.MoveAction) 改为 drag.accept(Qt.IgnoreAction),使光标显示禁止图标。onDropped 中 overflow-popup 源的处理保留但因拖拽在进入时被拒绝而不再触发, 符合预期行为 3. 影响:仅影响溢出弹窗内 overflow-popup 拖拽源进入时的光标显示, 其他拖拽源和拖放行为不变 Log: 溢出区域内拖拽图标时光标从移动状态改为禁止状态 Influence: 1. 在溢出弹窗内拖拽应用图标,确认光标显示为禁止图标而非移动光标 2. 从任务栏拖拽应用图标到溢出弹窗,确认光标和拖放行为无变化 3. 从溢出弹窗拖出应用图标,确认驻留属性保持不变 PMS: BUG-384773
6d54177 to
afdbf2c
Compare
|
TAG Bot New tag: 6.2.2 |
|
TAG Bot New tag: 6.2.2 |
Root Cause Analysis
The overflow popup DropArea in
TaskOverflowButton.qmlonly had anonDroppedhandler but was missingonEntered. When dragging an app icon inside the overflow popup, AppItem.qml configuresDrag.supportedActions: Qt.CopyAction | Qt.MoveAction, and without anonEnteredhandler callingdrag.accept(Qt.MoveAction), the dropAction stays at the platform default CopyAction. This causes the cursor to display a copy cursor (arrow with "+") instead of a move cursor (plain arrow). The main taskbar DropArea inTaskManager.qmlhas a completeonEnteredhandler and works correctly, serving as a positive reference.Fix
Added an
onEnteredhandler to the DropArea inTaskOverflowButton.qmlthat callsdrag.accept(Qt.MoveAction)when the drag source isoverflow-popup. The condition matches the existingonDroppedhandler, and the pattern aligns with the main taskbar DropArea inTaskManager.qml.Change Safety Assessment
Code Safety
cf0348bf(original feature commit), not a bug fix; subsequent fixes (BUG-384767, BUG-384405) touch different code segmentsBusiness Impact Scope
Affected: overflow popup drag-and-drop cursor display in the DDE taskbar. When users long-press and drag an app icon within the overflow popup, the cursor now shows a move cursor instead of a copy cursor. Drag-drop behavior (item reordering, residence preservation) is unchanged. External drags into the overflow popup (non-overflow-popup sources) are unaffected.
Verification Suggestion
根因分析
溢出弹窗
TaskOverflowButton.qml的 DropArea 仅有onDropped处理器,缺少onEntered。AppItem.qml 配置了Drag.supportedActions: Qt.CopyAction | Qt.MoveAction,拖拽进入溢出弹窗时未调用drag.accept(Qt.MoveAction),dropAction 保持平台默认的 CopyAction,光标显示为复制光标(箭头带"+"号)而非移动光标。主任务栏 DropArea(TaskManager.qml)有完整的onEntered处理器,功能正常,作为正面对照。修复方案
在
TaskOverflowButton.qml的 DropArea 添加onEntered处理器,当拖拽源为overflow-popup时调用drag.accept(Qt.MoveAction)。条件判断与现有onDropped一致,处理模式与主任务栏 DropArea 对齐。改动安全评估
代码安全评估
cf0348bf(原始功能提交)引入,非修复产物;后续修复(BUG-384767、BUG-384405)改的是不同代码段业务影响范围
影响范围:DDE 任务栏溢出弹窗拖拽光标显示。用户在溢出弹窗内长按拖拽应用图标时,光标从复制光标改为移动光标。拖放行为(图标重排、驻留属性)不变。从任务栏拖入溢出弹窗的外部拖拽不受影响。
验证建议
Summary by Sourcery
Bug Fixes: